<template>
  <!-- 家庭病床工作统计台账 -->
  <div>
    <h1>家庭病床工作统计台账</h1>
    <h3>统计时期：{{year}} 年 {{monthName}}</h3>
    <h2>
      <span>单位名称：湖北省中医院</span>
      <span>科室名称：{{officeName}}</span>
    </h2>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column label="日期" align="center" width></el-table-column>
      <el-table-column label="原有人数" align="center" width></el-table-column>
      <el-table-column label="新增人数" align="center" width></el-table-column>
      <el-table-column label="撤床病人数" align="center" width>
        <el-table-column label="小计" align="center" width></el-table-column>
        <el-table-column label="治愈" align="center" width></el-table-column>
        <el-table-column label="好转" align="center" width></el-table-column>
        <el-table-column label="未愈" align="center" width></el-table-column>
        <el-table-column label="死亡" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column label="留床人数" align="center" width></el-table-column>
      <el-table-column label="撤床病人占用床日数" align="center" width></el-table-column>
      <el-table-column label="撤床病人诊疗人次数" align="center" width></el-table-column>
      <el-table-column label="赴家庭病床诊疗人数" align="center" width></el-table-column>
    </el-table>
  </div>
</template>

<script>
import {} from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      year: "",
      month: "",
      monthName: "",
      officeName: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.month) {
        inpatientRegister({
          kb: this.dateList.administrative,
          sq: this.dateList.year + this.dateList.month
        }).then(res => {
          if (res.code === 0) {
            this.year = this.dateList.year;
            this.monthName = this.dateList.monthName;
            this.officeName = this.dateList.administrativeName;
            this.tableData = res.data;
            showOkMsg(res.msg);
          }
        });
      } else {
        showErrorMsg("请选择日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>